Kubernetes : Configure Container Node
2015/12/13 |
Install Kubernetes which is the Orchestration System for Docker Containers.
For example, Configure Kubernetes Cluster with 1 Admon Node and 2 Container Node like follows.
+---------------------+ | [ Admin Node ] | | dlp.srv.world | | | +----------+----------+ | +----------------------+ | +----------------------+ | [ Node01 ] |10.0.0.51 | 10.0.0.52| [ Node02 ] | | node01.srv.world +----------+----------+ node02.srv.world | | | | | +----------------------+ +----------------------+ |
Configure Container Node on this section.
|
|
[1] | |
[2] | Install Kubernetes and Flannel on All Nodes. |
[root@node01 ~]# yum -y install kubernetes flannel
|
[3] | Configure Kubernetes on all Nodes like follows. |
[root@node01 ~]#
vi /etc/kubernetes/config # line 22: change to Admin Node's hostname or IP address KUBE_MASTER="--master=http:// dlp.srv.world :8080"
[root@node01 ~]#
vi /etc/kubernetes/kubelet # line 5: change KUBELET_ADDRESS="--address= 0.0.0.0 "
# line 11: change to own hostname KUBELET_HOSTNAME="--hostname_override= node01 "
# line 14: change to Admin Node's hostname or IP address KUBELET_API_SERVER="--api_servers=http:// dlp.srv.world :8080"
[root@node01 ~]#
vi /etc/sysconfig/flanneld # line 4: change to Admin Node's hostname or IP address FLANNEL_ETCD="http:// dlp.srv.world :2379"
# stop docker0 interface [root@node01 ~]# nmcli c down docker0 Connection 'docker0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1) systemctl start flanneld kube-proxy kubelet [root@node01 ~]# systemctl enable flanneld kube-proxy kubelet [root@node01 ~]# systemctl restart docker |
[4] | Make sure th settings. It's OK if the status of each node is Ready like follows. |
[root@dlp ~]# kubectl get nodes NAME LABELS STATUS node01 kubernetes.io/hostname=node01 Ready node02 kubernetes.io/hostname=node02 Ready |